//
//  FinanceDetailViewController.m
//  Product_NEWS
//
//  Created by dllo on 15/12/28.
//  Copyright © 2015年 FCH. All rights reserved.
//

#import "FinanceDetailViewController.h"
#import "FinanceDetailView.h"
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width / 375.0)
// 获取屏幕高度
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height / 667.0)
@interface FinanceDetailViewController ()

@end

@implementation FinanceDetailViewController


    - (void)viewDidLoad {
        [super viewDidLoad];
        // Do any additional setup after loading the view.
        
        FinanceDetailView *headLineDV = [[FinanceDetailView alloc]initWithFrame:[[UIScreen mainScreen]bounds] FinanceModel:self.model];
        
        [self.view addSubview:headLineDV];
        self.navigationItem.title = @"新闻详情";
        self.navigationController.navigationBar.backgroundColor = [UIColor whiteColor];
//            [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"detail.png"] forBarMetrics:UIBarMetricsDefault];
        headLineDV.contentSize = CGSizeMake(headLineDV.frame.size.width, 400 +headLineDV.contentLabel.frame.size.height);
        [headLineDV release];
        
        
        UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [leftButton setImage:[UIImage imageNamed:@"iconfont-fanhui_meitu_1"] forState:UIControlStateNormal];
        leftButton.frame = CGRectMake(0, 0, 30*SCREEN_WIDTH, 30 * SCREEN_HEIGHT);
        [leftButton addTarget:self action:@selector(leftButtonAction:) forControlEvents:UIControlEventTouchUpInside];
        
        self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]initWithCustomView:leftButton]autorelease];
        
        UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [rightButton setImage:[UIImage imageNamed:@"iconfont-sangedian_meitu_2"] forState:UIControlStateNormal];
        rightButton.frame = CGRectMake(0, 0, 30 * SCREEN_WIDTH, 30 * SCREEN_HEIGHT);
        [rightButton addTarget:self action:@selector(rightButtonAction:) forControlEvents:UIControlEventTouchUpInside];
        
        self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]initWithCustomView:rightButton]autorelease];
        
        
        
        
    }
    
    
    
    -(void)leftButtonAction:(UIButton *)btn{
        
        [self.navigationController popToRootViewControllerAnimated:YES];
        
        
        
    }
    
    //收藏......!!!!!!!!
    -(void)rightButtonAction:(UIButton *)btn
    {
        
    }

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
